<div class="usuarios view">
	<?php echo $html->image('foto.jpg',array('class'=>'foto-perfil')); ?>
<h2><?php echo $usuario['Usuario']['nome']; ?></h2>
			ID: <?php echo $usuario['Usuario']['id']; ?><br />
			Login: <?php echo $usuario['Usuario']['login']; ?><br />
			Email: <?php echo $usuario['Usuario']['email']; ?><br />
			Senha: <?php echo $usuario['Usuario']['senha']; ?><br />

		
		<?php  if ($invite) : //se tem solicitacoes pendente  ?>	
					<br /> <br /> <br /><h3>Solicitações de novos amigos</h3>
					<?php 
					foreach($invite as $amigo):
						echo $amigo['Usuario']['nome'] . " é seu amigo? ";
						echo $this->Html->link(__('Sim', true), array('action' => 'accept_invite', $amigo['Usuario']['id']));
						echo " ";
						echo $this->Html->link(__('Não', true), array('action' => 'unregisterFriend', $amigo['Usuario']['id'], 1));
						echo "<br /><br />";
					endforeach;
				endif;
		?>


</div>
<div class="actions">
	<h3><?php __('Ações'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Mensagens', true), array('action' => 'mensagens')); ?> </li>
		<li><?php echo $this->Html->link(__('Editar Usuário', true), array('action' => 'edit', $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Deletar Usuário', true), array('action' => 'delete', $usuario['Usuario']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $usuario['Usuario']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Usuários', true), array('action' => 'index')); ?> </li>
		
		<li><?php echo $this->Html->link(__('New Usuario', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Usuarios', true), array('controller' => 'usuarios', 'action' => 'index')); ?> </li>
	</ul>

</div>

<div class="related">
	<h3>Amigos de <?php echo $usuario['Usuario']['nome']; ?></h3>
	<?php
	//Estranho isso aqui.... Testa uma variável mas imprime outra?
	//if (!empty($usuario['Amigo'])):
	if (!empty($amigos)):
	?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Nome'); ?></th>
		<th><?php __('Login'); ?></th>
		<th><?php __('Email'); ?></th>
		<th><?php __('Senha'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($amigos as $amigo):
			$amigo = $amigo['Amigo'];
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $amigo['id'];?></td>
			<td><?php echo $amigo['nome'];?></td>
			<td><?php echo $amigo['login'];?></td>
			<td><?php echo $amigo['email'];?></td>
			<td><?php echo $amigo['senha'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'usuarios', 'action' => 'view', $amigo['id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'usuarios', 'action' => 'edit', $amigo['id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'usuarios', 'action' => 'delete', $amigo['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $amigo['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
</div>
